import net.xilou.weibo.ConfigerHelper;
import org.apache.commons.dbutils.DbUtils;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 * Created by yong on 2016/3/22.
 */
public class DbTest {
    public static void main(String[] args) throws Exception {
        String driver = ConfigerHelper.get("jdbc.driver");
        String url = ConfigerHelper.get("jdbc.url");
        String userName = ConfigerHelper.get("jdbc.username");
        String password = ConfigerHelper.get("jdbc.password", "");
        System.out.println(password);

        Connection conn = null;
        DbUtils.loadDriver(driver);
        try {
             conn = DriverManager.getConnection(url, userName, password);
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            DbUtils.closeQuietly(conn);
        }
    }
}
